import xadmin
from apps.operation.models import *
class TopicTagAdmin(object):
    list_display = ["tag"]
    search_fields = ["tag"]
    list_filter = ["tag"]
    list_editable = ["tag"]

class TopicAdmin(object):
    list_display = ["author","title","text","likenum","commentnum","tag"]
    search_fields = ["author","title","text","likenum","commentnum","tag"]
    list_filter = ["author","title","text","likenum","commentnum","tag"]
    list_editable = ["author","title","text","likenum","commentnum","tag"]

class TopicImgAdmin(object):
    list_display = ["topic","show_image"]
    search_fields = ["topic","image"]
    list_filter = ["topic","image"]
    list_editable = ["topic","image"]

class LikeAdmin(object):
    list_display = ["user","topic","is_read"]
    search_fields = ["user","topic","is_read"]
    list_filter = ["user","topic","is_read"]
    list_editable = ["user","topic","is_read"]



class TopicCommentsAdmin(object):
    list_display = ["user","topic","comments","is_read"]
    search_fields = ["user","topic","comments","is_read"]
    list_filter = ["user","topic","comments","is_read"]
    list_editable = ["user","topic","comments","is_read"]

xadmin.site.register(TopicTag, TopicTagAdmin)
xadmin.site.register(Topic, TopicAdmin)
xadmin.site.register(TopicImg, TopicImgAdmin)
xadmin.site.register(Like, LikeAdmin)
xadmin.site.register(TopicComments, TopicCommentsAdmin)